import java.util.Scanner;

/**
 * @author gao
 * @date 2025/8/6 15:07
 */

public class Main {
    public static void main(String[] args) {
        String string = "H e l l o ! n o w c o d e r";
        Scanner scanner = new Scanner(System.in);
        String word = scanner.next();
        scanner.close();
        System.out.println(check(string, word));
    }

    public static int check(String str, String word) {
        int count = 0;
        char target = word.toLowerCase().charAt(0);
        for (int i = 0; i < str.length(); i++) {
            if (target == Character.toLowerCase(str.charAt(i))) {
                count++;
            }
        }
        return count;
    }
}